var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var ObjectId = require('mongoose').Schema.Types.ObjectId;
// var ObjectId = require('mongoose').Types.ObjectId;
// Define User schema 
var _comment = new Schema({ 
    content : String, 
    fromUser : {userid:{type:ObjectId},username:String}, 
    // toUser : {},
    // parentId:{type:ObjectId},
    lessionid : {type:ObjectId},
    up : Number,
    down : Number,
    create_time: { type: Date, default: Date.now },
    update_time: { type: Date, default: Date.now }
});

// export them 
exports.comment = mongoose.model('comment', _comment);